package com.southwind.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

import java.util.Arrays;

/**
 * 计算器日志切面类
 */
@Aspect
@Component
public class CalLogAop {

    @Before("execution(* com.southwind.service.*.*(..))")
    public void beforeCalLog(JoinPoint joinPoint) {
        String methodName = joinPoint.getSignature().getName();
        Object[] args = joinPoint.getArgs();
        System.out.println("计算器日志切面类：beforeCalLog方法执行");
        System.out.println("计算器日志切面类：正在执行方法：" + methodName + "，参数：" + Arrays.toString(args));
    }
}
